import {defHttp} from "@/utils/http/axios";

export function getDeviceList(param) {
  const { page =1, pageSize = 20, search = '' } = param;
  return defHttp.get({url: `/device/${page}/${pageSize}${search ? '?' + search : ''}`});
}

export function createDevice(data) {
  return defHttp.post({url: `/device`, data});
}

export function updateDevice(data) {
  const { id } = data
  return defHttp.put({url: `/device/${id}`, data});
}

export function deleteDevice(data) {
  const { id } = data
  return defHttp.delete({url: `/device/${id}`});
}
